Skip to content

refactor: CSS "condition" to SCSS condition #4690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 12, 2025

Conversation

mfranzke
Copy link
Collaborator

@mfranzke mfranzke commented Aug 6, 2025

Proposed changes

Currently we've checked for the elements to be either input or textarea at the CSS level with :is(). Instead as we're using those in a SCSS mixin, we should that for check for those element types in a SCSS condition.

The main purpose of this is to prevent resulting selectors like .db-input input:is(input,textarea):not(:disabled):read-only, which becomes .db-input input:not(:disabled):read-only

Types of changes

  • Bugfix (non-breaking change that fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improvements to existing components or architectural decisions)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Further comments

@mfranzke mfranzke self-assigned this Aug 6, 2025
@mfranzke mfranzke requested a review from nmerget as a code owner August 6, 2025 13:46
@mfranzke mfranzke added the 🍄🆙improvement New feature or request label Aug 6, 2025
@mfranzke mfranzke moved this to 👀 In review in UX Engineering Team Backlog Aug 6, 2025
@mfranzke mfranzke removed their assignment Aug 6, 2025
Copy link
Contributor

github-actions bot commented Aug 6, 2025

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@mfranzke mfranzke changed the title refactor: css condition to scss condition refactor: CSS "condition" to SCSS condition Aug 6, 2025
@mfranzke mfranzke enabled auto-merge (squash) August 6, 2025 14:38
mfranzke and others added 2 commits August 6, 2025 16:39
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This refactoring moves CSS element type checking from runtime CSS :is() selectors to build-time SCSS conditions, improving maintainability and performance by reducing CSS complexity. The change replaces CSS pseudo-selectors with SCSS conditional compilation.

  • Replaced CSS :is(input, textarea) selectors with SCSS @if conditions using list.index()
  • Added SCSS variables to define valid form field types for read-only and field-sizing properties
  • Updated CSS variable naming to be dynamic based on the element type

@mfranzke mfranzke merged commit 2be9529 into main Aug 12, 2025
53 checks passed
@mfranzke mfranzke deleted the refactor-css-condition-to-scss-condition branch August 12, 2025 14:42
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in UX Engineering Team Backlog Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍄🆙improvement New feature or request
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants